

import Log4R from "shared/component/log/Log4R";
import { AIClient, characterStateClient, move2DClient, scenceClient } from "./clientLib";
import ClassBase from "shared/component/robloxex/ClassBase";
const loginfo = Log4R.getLog('info')
/** 场景服务 */


scenceClient.onLoadScence(scenceEntity => {
    if (scenceEntity.aiConfigs)
        AIClient.syncAIConfig(scenceEntity.aiConfigs)
})
/* 区域进入事件 */
scenceClient.onAreaEnter(c => {
    // loginfo?.info('onAreaEnter', c)
    AIClient.onChangeArea(c)
})
/* 机关事件 */
scenceClient.onTrigger((trigger, toucher) => {
    // loginfo?.info('onTrigger', ClassBase.getA(trigger.config, 'TriggerBase'))
    const success = characterStateClient.changeStateByTrigger(trigger, toucher)
    if (success) {
        move2DClient.touchTrigger(trigger, toucher)
    }
})
